<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>layui</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="${base}/static/flow/lib/layui/css/layui.css"  media="all">
	<!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div style="margin-bottom: 5px;">

	<!-- 示例-970 -->
	<ins class="adsbygoogle" style="display:inline-block;width:970px;height:20px" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>

</div>

<div class="layui-btn-group demoTable">
	<button type="button" class="layui-btn" id="test1">
		<i class="layui-icon">&#xe67c;</i>上传图片
	</button>
</div>

<table class="layui-table" style="width: 95%">
	<colgroup>
		<col width="150">
		<col width="200">
		<col>
	</colgroup>
	<thead>
	<tr>
		<th>图片链接</th>
		<th>操作</th>

	</tr>
	</thead>
	<tbody>

	<#list scennicPics as scennicPic>
		<tr>
			<td>${scennicPic.scennicPicUrl}</td>
			<td>
				<a href="${base}/flowlight/jingdian.htm" class="layui-btn layui-btn-normal">查看图片</a>
			</td>
		</tr>
	</#list>
	</tbody>
</table>

<script type="text/html" id="barDemo">
	<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
	<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>


<script src="${base}/static/flow/lib/layui/layui.js" charset="utf-8"></script>
<script src="${base}/static/flow/static/js/admin.js" type="text/javascript" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use('upload', function(){
        var table = layui.table,
        	upload = layui.upload
        $ = layui.jquery;

        var uploadInst = upload.render({
            elem: '#test1' //绑定元素
            ,url: '${base}/flowlight/uploadPic' //上传接口
            ,done: function(res){
                var picUrl = res.data
                $.ajax({
                    type: 'post',
                    url: "${base}/flowlight/addjingdianPic",
                    data: {
                        scennicId:${scennicId},
                        scennicPicUrl:picUrl
                    },
                    success: function(res) {
                        window.parent.location.reload("${base}/flowlight/addjingdianPic.htm?scennicId=${scennicId}");
                    }
                });
            }

            ,error: function(){
                //请求异常回调
            }
        });
    });
</script>

</body>
</html>